<?php/** * Created by PhpStorm. * User: 文杰 * Date: 2018/11/15 * Time: 13:42 */namespace app\common\model;use think\Model;class Admin extends Model{    public function login($data){        $username=$data['username'];        $admins=$this->where('username',$username)->find();        if ($admins==null){            return $res=['code'=>1,'msg'=>"当前用户不存在!"];        }else{            $pass=md5($data['password']);            if($admins['status']==0){                return $res=['code'=>1,'msg'=>"当前用户已经被禁用!"];            }            if ($pass!=$admins['password']){                return $res=['code'=>1,'msg'=>"您输入的密码错误!"];            }            else{                return $res=['code'=>200,'msg'=>"恭喜您!"];            }        }    }}